home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / gcc / ixemul-4.lha / ixemul-41.4 / man / cat3 / radixsort.0 < prev    next >
Text File  |  1992-08-10  |  3KB  |  67 lines

  1.  
  2. RADIXSORT(3)               UNIX Programmer's Manual               RADIXSORT(3)
  3.  
  4. NNAAMMEE
  5.      rraaddiixxssoorrtt - radix sort
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<lliimmiittss..hh>>
  9.      ##iinncclluuddee <<ssttddlliibb..hh>>
  10.  
  11.      _i_n_t
  12.      rraaddiixxssoorrtt(_u___c_h_a_r _*_*_b_a_s_e, _i_n_t _n_m_e_m_b, _u___c_h_a_r _*_t_a_b_l_e, _u___c_h_a_r _e_n_d_b_y_t_e)
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.      The rraaddiixxssoorrtt() function is a modified radix sort.
  16.  
  17.      The rraaddiixxssoorrtt() function sorts an array of _n_m_e_m_b pointers to byte
  18.      strings, the initial member of which is referenced by _b_a_s_e. The byte
  19.      strings may contain any values; the end of each string is denoted by the
  20.      user­specified value _e_n_d_b_y_t_e. The contents of the array are sorted in as­
  21.      cending order according to the ASCII order of the byte strings they ref­
  22.      erence.
  23.  
  24.      Applications may specify a sort order by providing the _t_a_b_l_e argument.
  25.      If non­NULL, _t_a_b_l_e must reference an array of UCHAR_MAX + 1 bytes which
  26.      contains the sort weight of each possible byte value.  The end­of­string
  27.      byte must have a sort weight of 0.  More than one byte may have the same
  28.      sort weight.  The _t_a_b_l_e argument is useful for applications which wish to
  29.      sort different characters equally; for example, providing a table with
  30.      the same weights for A­Z as for a­z will result in a case­insensitive
  31.      sort.
  32.  
  33.      The rraaddiixxssoorrtt() function is stable, that is, if two elements compare as
  34.      equal, their order in the sorted array is unchanged.
  35.  
  36.      The rraaddiixxssoorrtt() function is a variant of most­significant­byte radix
  37.      sorting; in particular, see D.E. Knuth's Algorithm R and section 5.2.5,
  38.      exercise 10.  The rraaddiixxssoorrtt() function takes linear time relative to the
  39.      number of bytes in the strings.
  40.  
  41. RREETTUURRNN VVAALLUUEESS
  42.      Upon successful completion 0 is returned.  Otherwise, -1 is returned and
  43.      the global variable _e_r_r_n_o is set to indicate the error.
  44.  
  45. EERRRROORRSS
  46.      The rraaddiixxssoorrtt() function may fail and set _e_r_r_n_o for any of the errors
  47.      specified for the library routine malloc(3).
  48.  
  49. SSEEEE AALLSSOO
  50.      sort(1),  qsort(3)
  51.  
  52.      Knuth, D.E., "Sorting and Searching", _T_h_e _A_r_t _o_f _C_o_m_p_u_t_e_r _P_r_o_g_r_a_m_m_i_n_g,
  53.      Vol. 3, pp. 170­178, 1968.
  54.  
  55.      Paige, R., "Three Partition Refinement Algorithms", _S_I_A_M _J_. _C_o_m_p_u_t_., No.
  56.      6, Vol. 16, 1987.
  57.  
  58. HHIISSTTOORRYY
  59.      The rraaddiixxssoorrtt() function is currently under development.
  60.  
  61. BBUUGGSS
  62.      The _n_m_e_m_b argument must be less than the maximum integer, INT_MAX.
  63.  
  64. BSD Experimental                April 19, 1991                               1
  65.  
  66.  
  67.